package com.wish233.wiliwilivideo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wish233.wiliwiliapi.domain.vo.VideoVO;
import com.wish233.wiliwilivideo.domain.po.Video;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.cursor.Cursor;

import java.util.List;

/**
 * @author WHH
 * @description 针对表【video(视频表)】的数据库操作Mapper
 * @createDate 2025-03-04 16:39:04
 * @Entity com.wish233.wiliwilivideo.domain.po.Video
 */
public interface VideoMapper extends BaseMapper<Video> {

    @Update("UPDATE video SET likes = #{count} WHERE id = #{messageId}")
    void updateLikesById(@Param("messageId") Long messageId, @Param("count") Long count);

    @Select("SELECT ID FROM video")
    @Options(fetchSize = Integer.MIN_VALUE)
    Cursor<Long> getAllIdsStream();

    @Select("SELECT * FROM video")
    List<Video> getAllVideo();
}




